package com.springdemo.spring5.FactoryBean;

import com.springdemo.spring5.collectionType.Course;
import org.springframework.beans.factory.FactoryBean;

/**
 * Created with IntelliJ IDEA.
 * User: zjz
 * Date: 2022/02/24 14:57
 * Description:
 * Version: V1.0
 */
public class MyBean implements FactoryBean<Course> {
    //定义返回bean类型
    @Override
    public Course getObject() throws Exception {
        Course course=new Course();
        course.setCname("科比自传");
        return course;
    }
    @Override
    public Class<?> getObjectType() {
        return null;
    }
    @Override
    public boolean isSingleton() {
        return false;
    }
}
